/* Layout */
import Layout from '@/layout'
// 配置全局路由
export const constantRoutes = [
    {
        path: "/login",
        component: () => import("@/views/login/index"),
        hidden: true
      },
    {
      path: "/",
      redirect: "/login",
    },
      {
        path: "/404",
        component: () => import("@/views/404"),
        hidden: true
      },
    
      {
        path: "/dashboard",
        component: Layout,
        // redirect: "/dashboard",
        children: [
          {
            path: "dashboard",
            name: "Dashboard",
            component: () => import("@/views/dashboard/index"),
            meta: { title: "仪表盘", icon: "dashboard" }
          }
        ]
      },
]
//配置动态路由
export const allAsyncRoutes = [
      // 商户table
  {
    path: "/example",
    component: Layout,
    redirect: "/example/table",
    name: "Example",
    meta: { title: "商户管理", icon: "el-icon-s-help" },
    children: [
      {
        path: "table",
        name: "Table",
        component: () => import("@/views/table/index"),
        meta: { title: "商户", icon: "table" },
      },
      {
        path: "detail",
        name: "Detail"
      }
    ]
  },
  // 产品
  {
    path: "/form",
    component: Layout,
    redirect: "/form/form1",
    name: "form",
    meta: { title: "产品管理", icon: "form" },
    children: [
      {
        path: "table",
        name: "Table",
        component: () => import("@/views/form/index"),
        meta: { title: "产品", icon: "table" }
      },
      {
        path: "tree",
        name: "Tree"
      }
    ]
  },
//   用户
  {
    path: "/example1",
    component: Layout,
    redirect: "/example1/table",
    name: "Example1",
    meta: { title: "用户管理", icon: "el-icon-s-help" },
    children: [
      {
        path: "table",
        name: "user",
        component: () => import("@/views/user/index"),
        meta: { title: "用户", icon: "table" }
      },
      {
        path: "user",
        name: "user"
      }
    ]
  },
  // 交易管理
  {
    path: "/trading",
    component: Layout,
    redirect: "/trading/index",
    name: "Example",
    meta: { title: "交易管理", icon: "el-icon-s-help" },
    children: [
      {
        path: "index",
        name: "trading",
        component: () => import("@/views/trading/index"),
        meta: { title: "合同订单", icon: "el-icon-s-unfold" }
      },
      {
        path: "trading",
        name: "trading"
      }
    ]
  },
//   售后
  {
    path: "/example3",
    component: Layout,
    redirect: "/example3/table",
    name: "Example",
    meta: { title: "售后管理", icon: "el-icon-s-help" },
    children: [
      {
        path: 'product',
        name: 'product',
        component: () => import('@/views/prodect/index'),
        meta: { title: '售后', icon: 'table' }
      },
      {
        path: "index",
        name: "product"
      }
    ]
  },
]
//配置 404路由
export const anyRoute = { path: '*', redirect: '/404', hidden: true } 